The present invention relates to computer subsystems. More particularly, the present invention relates to a method and apparatus for communicating with one or more computer subsystems via a platform-independent communication protocol.
The need for increasingly powerful computer subsystems has mandated the development of increasingly sophisticated computer peripheral devices to off-load tasks from the host computer""s central processing unit (CPU). Examples include storage subsystems, graphics controllers, and network interface controllers, among others. Because such subsystems are often critical to the host system""s performance, the transfer of information between the CPU and its subsystems should incur as little overhead as reasonably possible. Further, it is preferable to maintain simplicity in the hardware used to communicate between the CPU and the subsystem, both for reasons of cost and reliability. Finally, a flexible approach which is not dependent on specific features of the given computing platform or operating system (OS) is also desirable.
When designing a controller for a computer subsystem (e.g., an intelligent small computer systems interface (SCSI) controller for a storage subsystem), it is thus generally desirable to offer the capability to communicate with that subsystem in a manner that meets the foregoing criteria. For example, this might take the form of controlling/configuring various features of the subsystem by sending commands from the host computer. The ability to monitor the health and/or performance of the subsystem from the host is also often desired.
Using the intelligent SCSI subsystem as an example, it can be seen that historically, the foregoing types of vendor-unique features have been implemented using some non-standard SCSI commands (e.g., Send Diagnostic and Receive Diagnostic commands). This approach, while straightforward, forces a software implementation of such functionality that is highly host-dependent. Moreover, the way in which an application program requests a SCSI driver to send these types of vendor-unique commands is in no way standardized in the industry. Therefore, new driver software modules must repeatedly written and re-written for the many different platforms and OSs commonly in use today. This repeated effort is a drain on the resources of those creating such software applications.
What is therefore desirable is a method and apparatus which permits an application program to communicate with a computer subsystem without the use of driver software written especially for supporting communications on a specific platform.
The present invention provides techniques that allow a host application to communicate with one or more computer subsystems via a communication protocol that is platform independent.
A method and apparatus according to the present invention implement a communications protocol whereby a host application program can communicate with a computer subsystem without the use of special driver software. In this way, the application program is able to invoke virtually any function on a compatible subsystem controller using only standard read/write system calls. This avoids platform dependency, greatly improving the portability of an application program using this technique.
One aspect of the present invention provides a computer-implemented method for communicating between a CPU and a subsystem. Communications according to the method of the present invention begin by writing a data packet to the subsystem. The data packet includes a signature and an identifier. The signature uniquely identifies the command as being a command to the subsystem under a protocol of the present invention. If information is to be returned from the subsystem, the central processing unit reads from the subsystem using the identifier. As with the signature, the use of this identifier indicates that the read is requesting the information generated by the last command whose data has not yet been read.
When a write is performed, the subsystem first detects the signature. Data which might be a command may be constantly checked by the subsystem to determine if the data being sent is indeed a command. Alternatively, only a subset of such commands might be checked. When such a signature is detected, the subsystem stores the identifier. This allows any accesses using the identifier to be classified as a subsystem command. Alternatively, when the central processing unit sends a read command to the subsystem that reads from a location identified by the identifier, the read is detected by analyzing the read command""s identifier. When such a read command is detected, the requisite information is returned from the subsystem to the central processing unit.
A further understanding of the nature and advantages of the invention described herein may be realized by reference to the remaining portions of the specification and the attached drawings.